home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / me39src1.arc / EDEF.H < prev    next >
C/C++ Source or Header  |  1987-07-16  |  12KB  |  282 lines

  1. /*    EDEF:        Global variable definitions for
  2.             MicroEMACS 3.9
  3.  
  4.             written by Dave G. Conroy
  5.             modified by Steve Wilhite, George Jones
  6.             greatly modified by Daniel Lawrence
  7. */
  8.  
  9. /* some global fuction declarations */
  10.  
  11. char *flook();
  12. char *getctext();
  13. char *getfname();
  14. char *getval();
  15. char *gtenv();
  16. char *gtfun();
  17. char *gtusr();
  18. char *itoa();
  19. char *ltos();
  20. char *malloc();
  21. char *mklower();
  22. char *mkupper();
  23. char *strcat();
  24. char *strcpy();
  25. char *strncpy();
  26. char *token();
  27. char *transbind();
  28. unsigned int getckey();
  29. unsigned int stock();
  30.  
  31. #ifdef    maindef
  32.  
  33. /* for MAIN.C */
  34.  
  35. /* initialized global definitions */
  36.  
  37. int     fillcol = 72;                   /* Current fill column          */
  38. short   kbdm[NKBDM];            /* Macro                        */
  39. char    *execstr = NULL;        /* pointer to string to execute    */
  40. char    golabel[NPAT] = "";        /* current line to go to    */
  41. int    execlevel = 0;            /* execution IF level        */
  42. int    eolexist = TRUE;        /* does clear to EOL exist    */
  43. int    revexist = FALSE;        /* does reverse video exist?    */
  44. int    flickcode = FALSE;        /* do flicker supression?    */
  45. char    *modename[] = {            /* name of modes        */
  46.     "WRAP", "CMODE", "SPELL", "EXACT", "VIEW", "OVER",
  47.     "MAGIC", "CRYPT", "ASAVE"};
  48. char    modecode[] = "WCSEVOMYA";    /* letters to represent modes    */
  49. int    gmode = 0;            /* global editor mode        */
  50. int    gfcolor = 7;            /* global forgrnd color (white)    */
  51. int    gbcolor    = 0;            /* global backgrnd color (black)*/
  52. int    gasave = 256;            /* global ASAVE size        */
  53. int    gacount = 256;            /* count until next ASAVE    */
  54. int     sgarbf  = TRUE;                 /* TRUE if screen is garbage    */
  55. int     mpresf  = FALSE;                /* TRUE if message in last line */
  56. int    clexec    = FALSE;        /* command line execution flag    */
  57. int    mstore    = FALSE;        /* storing text to macro flag    */
  58. int    discmd    = TRUE;            /* display command flag        */
  59. int    disinp    = TRUE;            /* display input characters    */
  60. struct    BUFFER *bstore = NULL;        /* buffer to store macro text to*/
  61. int     vtrow   = 0;                    /* Row location of SW cursor */
  62. int     vtcol   = 0;                    /* Column location of SW cursor */
  63. int     ttrow   = HUGE;                 /* Row location of HW cursor */
  64. int     ttcol   = HUGE;                 /* Column location of HW cursor */
  65. int    lbound    = 0;            /* leftmost column of current line
  66.                        being displayed */
  67. int    taboff    = 0;            /* tab offset for display    */
  68. int    metac = CTRL | '[';        /* current meta character */
  69. int    ctlxc = CTRL | 'X';        /* current control X prefix char */
  70. int    reptc = CTRL | 'U';        /* current universal repeat char */
  71. int    abortc = CTRL | 'G';        /* current abort command char    */
  72.  
  73. int    quotec = 0x11;            /* quote char during mlreply() */
  74. char    *cname[] = {            /* names of colors        */
  75.     "BLACK", "RED", "GREEN", "YELLOW", "BLUE",
  76.     "MAGENTA", "CYAN", "WHITE"};
  77. KILL *kbufp  = NULL;        /* current kill buffer chunk pointer    */
  78. KILL *kbufh  = NULL;        /* kill buffer header pointer        */
  79. int kused = KBLOCK;        /* # of bytes used in kill buffer    */
  80. WINDOW *swindow = NULL;        /* saved window pointer            */
  81. int cryptflag = FALSE;        /* currently encrypting?        */
  82. short    *kbdptr;        /* current position in keyboard buf */
  83. short    *kbdend = &kbdm[0];    /* ptr to end of the keyboard */
  84. int    kbdmode = STOP;        /* current keyboard macro mode    */
  85. int    kbdrep = 0;        /* number of repetitions    */
  86. int    restflag = FALSE;    /* restricted use?        */
  87. int    lastkey = 0;        /* last keystoke        */
  88. int    seed = 0;        /* random number seed        */
  89. long    envram = 0l;    /* # of bytes current in use by malloc */
  90. int    macbug = FALSE;        /* macro debuging flag        */
  91. char    errorm[] = "ERROR";    /* error literal        */
  92. char    truem[] = "TRUE";    /* true literal            */
  93. char    falsem[] = "FALSE";    /* false litereal        */
  94. int    cmdstatus = TRUE;    /* last command status        */
  95. char    palstr[49] = "";    /* palette string        */
  96. int    saveflag = 0;        /* Flags, saved with the $target var */
  97. char    *fline = NULL;        /* dynamic return line */
  98. int    flen = 0;        /* current length of fline */
  99.  
  100. /* uninitialized global definitions */
  101.  
  102. int     currow;                 /* Cursor row                   */
  103. int     curcol;                 /* Cursor column                */
  104. int     thisflag;               /* Flags, this command          */
  105. int     lastflag;               /* Flags, last command          */
  106. int     curgoal;                /* Goal for C-P, C-N            */
  107. WINDOW  *curwp;                 /* Current window               */
  108. BUFFER  *curbp;                 /* Current buffer               */
  109. WINDOW  *wheadp;                /* Head of list of windows      */
  110. BUFFER  *bheadp;                /* Head of list of buffers      */
  111. BUFFER  *blistp;                /* Buffer for C-X C-B           */
  112.  
  113. BUFFER  *bfind();               /* Lookup a buffer by name      */
  114. WINDOW  *wpopup();              /* Pop up window creation       */
  115. LINE    *lalloc();              /* Allocate a line              */
  116. char    sres[NBUFN];        /* current screen resolution    */
  117.  
  118. char    pat[NPAT];                      /* Search pattern        */
  119. char    tap[NPAT];            /* Reversed pattern array.    */
  120. char    rpat[NPAT];            /* replacement pattern        */
  121.  
  122. /* The variable matchlen holds the length of the matched
  123.  * string - used by the replace functions.
  124.  * The variable patmatch holds the string that satisfies
  125.  * the search command.
  126.  * The variables matchline and matchoff hold the line and
  127.  * offset position of the start of match.
  128.  */
  129. unsigned int    matchlen = 0;
  130. unsigned int    mlenold  = 0;
  131. char        *patmatch = NULL;
  132. LINE        *matchline = NULL;
  133. int        matchoff = 0;
  134.  
  135. #if    MAGIC
  136. /*
  137.  * The variable magical determines if there are actual
  138.  * metacharacters in the string - if not, then we don't
  139.  * have to use the slower MAGIC mode search functions.
  140.  */
  141. short int    magical = FALSE;
  142. MC        mcpat[NPAT];        /* the magic pattern        */
  143. MC        tapcm[NPAT];        /* the reversed magic pattern    */
  144.  
  145. #endif
  146.  
  147. /* directive name table:
  148.     This holds the names of all the directives....    */
  149.  
  150. char *dname[] = {
  151.     "if", "else", "endif",
  152.     "goto", "return", "endm",
  153.     "while", "endwhile", "break",
  154.     "force"
  155. };
  156.  
  157. #if    DEBUGM
  158. /*    vars needed for macro debugging output    */
  159. char outline[NSTRING];        /* global string to hold debug line text */
  160. #endif
  161.  
  162. #else
  163.  
  164. /* for all the other .C files */
  165.  
  166. /* initialized global external declarations */
  167.  
  168. extern  int     fillcol;                /* Fill column                  */
  169. extern  short   kbdm[];                 /* Holds kayboard macro data    */
  170. extern  char    pat[];                  /* Search pattern               */
  171. extern    char    rpat[];            /* Replacement pattern        */
  172. extern    char    *execstr;        /* pointer to string to execute    */
  173. extern    char    golabel[];        /* current line to go to    */
  174. extern    int    execlevel;        /* execution IF level        */
  175. extern    int    eolexist;        /* does clear to EOL exist?    */
  176. extern    int    revexist;        /* does reverse video exist?    */
  177. extern    int    flickcode;        /* do flicker supression?    */
  178. extern    char *modename[];        /* text names of modes        */
  179. extern    char    modecode[];        /* letters to represent modes    */
  180. extern    KEYTAB keytab[];        /* key bind to functions table    */
  181. extern    NBIND names[];            /* name to function table    */
  182. extern    int    gmode;            /* global editor mode        */
  183. extern    int    gfcolor;        /* global forgrnd color (white)    */
  184. extern    int    gbcolor;        /* global backgrnd color (black)*/
  185. extern    int    gasave;            /* global ASAVE size        */
  186. extern    int    gacount;        /* count until next ASAVE    */
  187. extern  int     sgarbf;                 /* State of screen unknown      */
  188. extern  int     mpresf;                 /* Stuff in message line        */
  189. extern    int    clexec;            /* command line execution flag    */
  190. extern    int    mstore;            /* storing text to macro flag    */
  191. extern    int    discmd;            /* display command flag        */
  192. extern    int    disinp;            /* display input characters    */
  193. extern    struct    BUFFER *bstore;        /* buffer to store macro text to*/
  194. extern    int     vtrow;                  /* Row location of SW cursor */
  195. extern    int     vtcol;                  /* Column location of SW cursor */
  196. extern    int     ttrow;                  /* Row location of HW cursor */
  197. extern    int     ttcol;                  /* Column location of HW cursor */
  198. extern    int    lbound;            /* leftmost column of current line
  199.                        being displayed */
  200. extern    int    taboff;            /* tab offset for display    */
  201. extern    int    metac;            /* current meta character */
  202. extern    int    ctlxc;            /* current control X prefix char */
  203. extern    int    reptc;            /* current universal repeat char */
  204. extern    int    abortc;            /* current abort command char    */
  205.  
  206. extern    int    quotec;            /* quote char during mlreply() */
  207. extern    char    *cname[];        /* names of colors        */
  208. extern KILL *kbufp;            /* current kill buffer chunk pointer */
  209. extern KILL *kbufh;            /* kill buffer header pointer    */
  210. extern int kused;            /* # of bytes used in KB        */
  211. extern WINDOW *swindow;            /* saved window pointer        */
  212. extern int cryptflag;            /* currently encrypting?    */
  213. extern    short    *kbdptr;        /* current position in keyboard buf */
  214. extern    short    *kbdend;        /* ptr to end of the keyboard */
  215. extern    int kbdmode;            /* current keyboard macro mode    */
  216. extern    int kbdrep;            /* number of repetitions    */
  217. extern    int restflag;            /* restricted use?        */
  218. extern    int lastkey;            /* last keystoke        */
  219. extern    int seed;            /* random number seed        */
  220. extern    long envram;        /* # of bytes current in use by malloc */
  221. extern    int    macbug;            /* macro debuging flag        */
  222. extern    char    errorm[];        /* error literal        */
  223. extern    char    truem[];        /* true literal            */
  224. extern    char    falsem[];        /* false litereal        */
  225. extern    int    cmdstatus;        /* last command status        */
  226. extern    char    palstr[];        /* palette string        */
  227. extern    int    saveflag;        /* Flags, saved with the $target var */
  228. extern    char    *fline;            /* dynamic return line */
  229. extern    int    flen;            /* current length of fline */
  230.  
  231. /* uninitialized global external declarations */
  232.  
  233. extern  int     currow;                 /* Cursor row                   */
  234. extern  int     curcol;                 /* Cursor column                */
  235. extern  int     thisflag;               /* Flags, this command          */
  236. extern  int     lastflag;               /* Flags, last command          */
  237. extern  int     curgoal;                /* Goal for C-P, C-N            */
  238. extern  WINDOW  *curwp;                 /* Current window               */
  239. extern  BUFFER  *curbp;                 /* Current buffer               */
  240. extern  WINDOW  *wheadp;                /* Head of list of windows      */
  241. extern  BUFFER  *bheadp;                /* Head of list of buffers      */
  242. extern  BUFFER  *blistp;                /* Buffer for C-X C-B           */
  243.  
  244. extern  BUFFER  *bfind();               /* Lookup a buffer by name      */
  245. extern  WINDOW  *wpopup();              /* Pop up window creation       */
  246. extern  LINE    *lalloc();              /* Allocate a line              */
  247. extern    char    sres[NBUFN];        /* current screen resolution    */
  248. extern    char    pat[];                  /* Search pattern        */
  249. extern    char    tap[];            /* Reversed pattern array.    */
  250. extern    char    rpat[];            /* replacement pattern        */
  251.  
  252. extern    unsigned int    matchlen;    /* length of found string    */
  253. extern    unsigned int    mlenold;    /* previous length of found str    */
  254. extern    char    *patmatch;        /* the found string        */
  255. extern    LINE    *matchline;        /* line pointer to found string    */
  256. extern    int    matchoff;        /* offset to the found string    */
  257.  
  258. #if    MAGIC
  259.  
  260. extern    short int    magical;    /* meta-characters in pattern?    */
  261. extern    MC        mcpat[];    /* the magic pattern        */
  262. extern    MC        tapcm[];    /* the reversed magic pattern    */
  263.  
  264. #endif
  265.  
  266. extern char *dname[];            /* directive name table        */
  267.  
  268. #if    DEBUGM
  269. /*    vars needed for macro debugging output    */
  270. extern char outline[];        /* global string to hold debug line text */
  271. #endif
  272.  
  273. #endif
  274.  
  275. /* terminal table defined only in TERM.C */
  276.  
  277. #ifndef    termdef
  278. extern  TERM    term;                   /* Terminal information.        */
  279. #endif
  280.  
  281.  
  282.